package com.nhy.bloggers.service;

import com.nhy.bloggers.entity.Blog;
import com.nhy.bloggers.mapper.BlogMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class BlogService {
    @Autowired
    private BlogMapper blogMapper;

    public List<Blog> getBlogList(){
        return blogMapper.selectAllBlog();
    }

    public Blog getBlogDetail(Integer blogId){
        return blogMapper.selectById(blogId);
    }

    public int insertBlog(Blog record){
        return blogMapper.insertBlog(record);
    }

    public void updateBlog(Blog blog) {
        blogMapper.updateBlog(blog);
    }
}
